<template>
	<view>
		<view class="search">
			<u-search placeholder="寻找感兴趣的商品" @search="search" v-model="key" auto-focus="focus" :fixed="focus" :clearabled="true"
			 focus :show-action="false" v-bind:class="$store.state.searchStyle"></u-search>
		</view>
		<!-- 搜索之前的 -->
		<noGoods :noGoods="noGoods" @tabClick="tabClick(index)"  v-if=" searchList.length<0"></noGoods>
		<!-- 搜索后的 -->
		<searchList :searchList="searchList" v-if="searchList.length > 0"></searchList>
	</view>
</template>

<script>
	import noGoods from "@/pages/search/nogoods.vue"
	import searchList from "@/pages/search/search-list.vue"
	import json from "@/json/index.js"
	export default {
		components: {
			noGoods,
			searchList
		},
		onLoad() {
			this.searchList = json.searchList
			this.noGoods = json.commodityList
		},
		data() {
			return {
				noGoods: [],
				searchList: []
			};
		},
		methods: {
			
			
		}
	}
</script>

<style lang="scss">
	.search {
		background-color: #ffffff;
		padding: 20rpx;
	}
</style>
